#include "Alice.h"
using namespace alice;

CIOCP::CIOCP( DWORD NumberOfConcurrentThreads ) {
	m_hIOCP = CreateIoCompletionPort( INVALID_HANDLE_VALUE,
		NULL, 0, NumberOfConcurrentThreads );
}

CIOCP::~CIOCP( void ) {
	CloseHandle( m_hIOCP );
}

BOOL CIOCP::AssociateDevice( HANDLE FileHandle, ULONG_PTR CompletionKey ) {
	return ( m_hIOCP == CreateIoCompletionPort( FileHandle, m_hIOCP, 
		CompletionKey, 0 ) );
}